<div class="table-body">
    <div class="layui-card-header">添加发货地址</div>
    <div class="layui-card">
        <form class="layui-form layui-form-pane">
            <div class="layui-form-item">
                <label class="layui-form-label">发货人：</label>
                <div class="layui-input-inline seller-inline-5">
                    <input type="text" name="name" required lay-verify="required" placeholder="请输入发货人" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">联系手机：</label>
                <div class="layui-input-inline seller-inline-5">
                    <input type="text" name="mobile" required lay-verify="required" placeholder="请输入手机号码" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">发货地区：</label>
                <div class="layui-input-inline seller-inline-5 address-class">
                    {zbshop:area name='area_id' class="select-address" lay-verify="required"/}
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">发货地址：</label>
                <div class="layui-input-inline from-inline-3">
                    <input type="text" name="address" required lay-verify="required" placeholder="请输入发货地址" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否默认：</label>
                <div class="layui-input-inline">
                    <input type="radio" name="is_def" value="1" title="是">
                    <input type="radio" name="is_def" value="2" title="否" checked="">
                </div>
            </div>
             <div class="layui-form-item">
                <div class="layui-input-block" style="padding-top: 20px;">
                    {:zbToken()}
                    <button class="layui-btn save-ship" lay-submit="" lay-filter="add-ship">保存</button>
                    <a href="javascript:history.back(-1);" class="layui-btn layui-btn-primary" lay-filter="cancleAuthor">返回</a>
                </div>
             </div>
        </form>
    </div>
</div>
<script>
    layui.use(['table', 'form', 'layer'], function() {
        var layer = layui.layer, form = layui.form, $ = layui.$;
        form.render();
        form.on('submit(add-ship)', function(data) {
            JsPost("{:url('shop/add')}",data.field,function(res){
                if (res.code===1) {
                    layer.msg(res.msg,{icon:6},function(){
                        window.location.href = "{:url('address')}";
                    });
                } else {
                    layer.msg(res.msg, {icon: 5});
                }
            });
            return false;
        });

    });
</script>